package smallestRangeI;

import java.util.Arrays;

public class Solution {
    public int smallestRangeI(int[] nums, int k) {
        Arrays.sort(nums);
        //升序
        return Math.max(nums[nums.length-1]-nums[0]-k*2,0);
    }
}
